Passed
Branch master (c3a882)
by Dmytro
01:26
created

entry.js ➔ _load   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
1
/* eslint-disable security/detect-non-literal-require */
2
import path from 'path';
3
4
const isBuild = process.env.BUILD && [ '1', 'true' ].includes(process.env.BUILD);
5
const entry = process.env.ENTRY && path.resolve(process.env.ENTRY)
6
|| isBuild && path.resolve(__dirname, '../lib')
7
|| path.resolve(__dirname, '../src');
8
9
module.exports = require(entry);
10
11
export function _load(relPath) {
12
    return require(path.join(entry, relPath));
13
}
14